home *** CD-ROM | disk | FTP | other *** search
- Path: nntphost.dur.ac.uk!nntp
- From: M D Sergeant <M.D.Sergeant@durham.ac.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: C++ Classes
- Date: 17 Apr 1996 14:23:01 GMT
- Organization: University of Durham, Durham, UK
- Message-ID: <4l2us5$p58@mercury.dur.ac.uk>
- References: <Stewart_Menday.3jrp@kumear.DIALix.oz.au>
- NNTP-Posting-Host: jones.dur.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.05 9000/710)
- X-URL: news:Stewart_Menday.3jrp@kumear.DIALix.oz.au
-
- Stewart_Menday@kumear.DIALix.oz.au (Stewart Menday) wrote:
- >Hi ALL
- > I have a question about C++ and calling functions which have been
- >overriden.
- >
- >If I have a class x say and it is derived from class y say and they both a
- >method print() say. How do I call class y print from within class x?
- >
- >e.g.
- >
- >y.h
- >
- >class y{
- >public:
- > void print();
- > \
- > /
- > \
- > /
- >
- >}
- >
- >x.h
- >
- >class x:public y{
- >public:
- > void print();
- > \
- > /
- > \
- > /
- >}
- >
- >x.cc
- >
- >void x::print();
- >{
- > //some stuff for x
- >
- > //I wish to call y.print
- y::print(); // Easy huh!
-
- >}
- >
- >Any help would be great.
- >
-
- Matt.
-
- --
- m.d.sergeant@dur.ac.uk Computer Science Project:
- Matthew Sergeant GUI for LOLITA
- University of Durham (And wow, is it ever gooey)
-
-